from .base_models import BaseModel
from django.db import models
from base.models import App

#纳税人基本信息
class Taxpayer(BaseModel):
    app = models.ForeignKey(App, on_delete=models.CASCADE, verbose_name='所属应用')
    name = models.CharField(max_length=50, verbose_name='纳税人名称',default='')
    nsrsbh = models.CharField(max_length=20, verbose_name='纳税人识别号',default='')
    djxh = models.CharField(max_length=20, verbose_name='登记序号',default='')
    ssdabh = models.CharField(max_length=20, verbose_name='税收档案编号',default='')
    class NSRLX_CHOICES(models.TextChoices):
        GENERAL_TAXPAYER = '1', '一般纳税人'
        SMALL_SCALE_TAXPAYER = '2', '小规模纳税人'
        TRANSFERRED_SMALL_SCALE_TAXPAYER = '3', '转登记小规模纳税人'
        GUIDANCE_PERIOD_GENERAL_TAXPAYER = '4', '辅导期一般纳税人'
        INDIVIDUAL = '5', '自然人'

    nsrlx = models.CharField(max_length=2, choices=NSRLX_CHOICES, verbose_name='纳税人类型',
                             default=NSRLX_CHOICES.GENERAL_TAXPAYER)
    scjydz = models.CharField(max_length=300, verbose_name='生产经营地址',default='')
    zcdyzbm = models.CharField(max_length=6, verbose_name='注册地邮政编码',default='')
    zcdlxdh = models.CharField(max_length=60, verbose_name='注册地联系电话',default='')
    fddbrxm = models.CharField(max_length=150, verbose_name='法人名称(法定代表人姓名)',default='')
    djzclxdm = models.CharField(max_length=3, verbose_name='登记注册类型（国标）',default='')
    hydm = models.CharField(max_length=4, verbose_name='行业代码',default='')
    qxjswjgdm = models.CharField(max_length=11, verbose_name='区县级税务机关',default='')
    zgswskfjdm = models.CharField(max_length=11, verbose_name='税务机关代码',default='')
    zgswskfjmc = models.CharField(max_length=300, verbose_name='税务机关名称',default='')
    cwfzrxm = models.CharField(max_length=150, verbose_name='财务负责人姓名',default='')
    khhmc = models.CharField(max_length=300, verbose_name='开户行名称',default='')
    yhzh = models.CharField(max_length=30, verbose_name='首选账户账号',default='')
    bsrxm = models.CharField(max_length=150, verbose_name='企业办税人员姓名',default='')
    xdpsdqybz = models.CharField(max_length=20, verbose_name='数电票试点企业标识',default='N')
    class CKQYFLDM_CHOICES(models.TextChoices):
        none = '','非出口企业'
        level1 = '01', '一类出口企业'
        level2 = '02', '二类出口企业'
        level3 = '03', '三类出口企业'
        level4 = '04', '四类出口企业'
    ckqyfldm = models.CharField(max_length=10, verbose_name='出口许可证分类代码',choices=CKQYFLDM_CHOICES,default=CKQYFLDM_CHOICES.none)
    class ZFJGLX_CHOICES(models.TextChoices):
        none = '0','非金融机构'
        head_office = '1','总机构'
        branch = '2','分支机构'
        branch_headquarters = '3','分总机构'
    zfjglxdm = models.CharField(max_length=10, verbose_name='总分机构类型',choices=ZFJGLX_CHOICES,default=ZFJGLX_CHOICES.none)
    yhyywddm = models.CharField(max_length=13, verbose_name='银行营业网点',default='')
    class NSRZTDM_CHOICES(models.TextChoices):
        none = '01','受理'
        preparation = '02','筹建期'
        normal = '03','正常'
        close = '04','停业'
        abnormal = '05','非正常'
        liquidation = '06','清算'
        invalid = '07','注销'
        abnormal_invalid = '08','非正常注销'
        inspection = '09','报验'
        verification_inspection = '10','核销报验'
        interrupt_payment = '11','中断缴费'
        recovery_payment = '12','恢复缴费'
        simplified_invalid = '13','简易注销无异议'
        other = '99','其他'

    nsrztdm = models.CharField(max_length=2, verbose_name='纳税人状态代码',choices=NSRZTDM_CHOICES,default=NSRZTDM_CHOICES.none)
    yxqq = models.DateField(verbose_name='纳税人类型标签有效期起',null=True,blank=True)
    yxqz = models.DateField(verbose_name='纳税人类型标签有效期止',null=True,blank=True)
    class QYHYXZDM_CHOICES(models.TextChoices):
        CHENG_PIN_YOU_SHENG_CHAN_QI_YE = '01', '成品油生产企业'
        CHENG_PIN_YOU_JING_XIAO_QI_YE = '02', '成品油经销企业'
        GUO_NAI_JI_DONG_CHE_SHENG_CHAN_QI_YE = '03', '国内机动车生产企业'
        JIN_KOU_JI_DONG_CHE_SHENG_CHAN_QI_YE = '04', '进口机动车生产企业驻我国办事机构或总授权代理机构'
        JI_DONG_CHE_SHOU_QUAN_JING_XIAO_QI_YE = '05', '机动车授权经销企业'
        QI_TA_JI_DONG_CHE_MAO_YI_SHANG = '06', '其他机动车贸易商'
        ER_SHOU_CHE_SHI_CHANG = '07', '二手车市场'
        ER_SHOU_CHE_JING_XIAO_QI_YE = '08', '二手车经销企业'
        ER_SHOU_CHE_PAI_MAI_QI_YE = '09', '二手车拍卖企业'
        XI_TU_KUANG_CHAN_QI_YE = '10', '稀土矿产企业'
        XI_TU_YE_LIAN_FEN_LI_QI_YE = '11', '稀土冶炼分离企业'
        XI_TU_QI_TA_QI_YE = '12', '稀土其他企业'
        XI_TU_KUANG_CHAN_QI_YE_YE_LIAN_FEN_LI_QI_YE_QI_TA_QI_YE = '13', '稀土矿产企业、稀土冶炼分离企业、稀土其他企业'
        XI_TU_KUANG_CHAN_QI_YE_YE_LIAN_FEN_LI_QI_YE = '14', '稀土矿产企业、稀土冶炼分离企业'
        XI_TU_KUANG_CHAN_QI_YE_QI_TA_QI_YE = '15', '稀土矿产企业、稀土其他企业'
        XI_TU_YE_LIAN_FEN_LI_QI_YE_QI_TA_QI_YE = '16', '稀土冶炼分离企业、稀土其他企业'
        JUAN_YAN_SHENG_CHAN_QI_YE = '17', '卷烟生产企业'
        JUAN_YAN_PI_FAN_QI_YE = '18', '卷烟批发企业'
        JUAN_YAN_CHU_KOU_QI_YE = '19', '卷烟出口企业'
        SHENG_CHAN_XING_CHU_KOU_QI_YE = '20', '生产型出口企业'
        WAI_MAO_XING_CHU_KOU_QI_YE = '21', '外贸型出口企业'
        WAI_MAO_ZONG_HE_FU_WU_QI_YE = '22', '外贸综合服务企业'
        ZI_MAO_QU_SHI_DIAN_QI_YE = '23', '自贸区试点企业'
        TE_SHU_JIAN_GUAN_QU_NEI_QI_YE = '24', '特殊监管区内企业'
        ZENG_ZHI_SHUI_YI_BAN_NA_SHUI_REN_ZI_QI_YAN_SHI_DIAN = '25', '增值税一般纳税人资格试点'
        SHI_CHANG_CAI_GOU_SHI_DIAN = '26', '市场采购试点'
        TUI_SHUI_SHANG_DIAN = '27', '退税商店'
        DIAN_ZI_SHANG_WU_CHU_KOU_QI_YE = '28', '电子商务出口企业'
        XIANG_SHOU_EXPORT_TUI_SHUI_ZHENG_CE_DE_RONG_ZI_ZU_LING_QI_YE = '29', '享受出口退税政策的融资租赁企业'
        ZENG_ZHI_SHUI_LING_SHUI_LI_YING_TI_GONG_ZHE = '30', '增值税零税率应税服务提供者'
        FANG_DI_CHAN_KAI_FA_QI_YE = '31', '房地产开发企业'
        NONG_CHAN_PIN_SHEN_JIANG_QI_YE = '32', '农产品深加工企业'
        WAI_GOU_SHI_NAO_YOU_REN_LIAO_YONG_YU_XIANG_YIN_SHUI_TUI_SHUI_QI_YE = '33', '外购石脑油、燃料油用于消费税退税企业'
        CONG_SHI_JI_DONG_CHE_JIN_KOU_DE_QI_TA_MAO_YI_SHANG = '34', '从事机动车进口的其他贸易商'
        ZI_CHAN_NONG_CHAN_PIN_ZHE = '35', '自产农产品者'
        NONG_CHAN_PIN_SHOU_GOU_QI_YE = '36', '农产品收购企业'
        GUANG_FU_SHOU_GOU_QI_YE = '37', '光伏收购企业'
        ZHU_FANG_ZU_LIN_QI_YE = '38', '住房租赁企业'
        DONG_AO_HUI_TUI_SHUI_QI_YE = '39', '冬奥会退税企业'
    qyhyxzdm = models.CharField(max_length=10, verbose_name='企业行业性质',
                                choices=QYHYXZDM_CHOICES,null=True,blank=True,default=None)

    class XFSNSRLXDM_CHOICES (models.TextChoices):
        CIGARETTE_PRODUCTION = '01', '卷烟生产消费税纳税人'
        CIGARETTE_WHOLESALER = '02', '卷烟批发消费税纳税人'
        BAIJIU_PRODUCTION = '03', '白酒生产消费税纳税人'
        HUANGJIU_PRODUCTION = '04', '黄酒生产消费税纳税人'
        BEER_PRODUCTION = '05', '啤酒生产消费税纳税人'
        OTHER_ALCOHOL_PRODUCTION = '06', '其他酒生产消费税纳税人'
        SMALL_CAR_PRODUCTION = '07', '小汽车生产消费税纳税人'
        LUXURY_CAR = '08', '超豪华小汽车消费税纳税人'
        GASOLINE_PRODUCTION = '09', '汽油生产消费税纳税人'
        NAPHTHA_PRODUCTION = '10', '石脑油生产消费税纳税人'
        SOLVENT_OIL_PRODUCTION = '11', '溶剂油生产消费税纳税人'
        LUBRICATING_OIL_PRODUCTION = '12', '润滑油生产消费税纳税人'
        DIESEL_PRODUCTION = '13', '柴油生产消费税纳税人'
        AVIATION_KEROSENE_PRODUCTION = '14', '航空煤油生产消费税纳税人'
        FUEL_OIL_PRODUCTION = '15', '燃料油生产消费税纳税人'
        BATTERY_PRODUCTION = '16', '电池生产消费税纳税人'
        COATING_PRODUCTION = '17', '涂料生产消费税纳税人'
        HIGH_END_COSMETICS_PRODUCTION = '18', '高档化妆品生产消费税纳税人'
        JEWELRY_RETAIL = '19', '金银首饰铂金首饰和钻石及钻石饰品零售消费税纳税人'
        OTHER_VALUE_JEWELRY_PRODUCTION = '20', '其他贵重首饰和珠宝玉石生产消费税纳税人'
        FIREWORKS_PRODUCTION = '21', '鞭炮焰火生产消费税纳税人'
        MOTORCYCLE_PRODUCTION = '22', '摩托车生产消费税纳税人'
        GOLF_EQUIPMENT_PRODUCTION = '23', '高尔夫球及球具生产消费税纳税人'
        HIGH_END_WATCH_PRODUCTION = '24', '高档手表生产消费税纳税人'
        YACHT_PRODUCTION = '25', '游艇生产消费税纳税人'
        WOODEN_DISPOSABLE_CHOPSTICKS = '26', '木制一次性筷子生产消费税纳税人'
        SOLID_WOOD_FLOOR_PRODUCTION = '27', '实木地板生产消费税纳税人'
        CIGAR_PRODUCTION = '28', '雪茄烟生产消费税纳税人'
        TOBACCO_LEAF_PRODUCTION = '29', '烟丝生产消费税纳税人'

    xfsnsrlxdm = models.CharField(max_length=20, verbose_name='消费税纳税人类型',null=True,blank=True,
                                  choices=XFSNSRLXDM_CHOICES)
                                
    class Meta:
        verbose_name = '纳税人信息'
        verbose_name_plural = verbose_name

